<template>
    <!-- 组件页面 -->
    <view class="tickets" style="display: flex; margin-top: 15rpx">
        <view class="l-tickets">{{ ltextClone }}</view>
        <view class="r-tickets">
            {{ rtext }}
            <view v-if="!pickClone" class="btn_lq f fpc" @tap="pickClone">立即领取</view>
            <view v-else class="btn_lq2 f fpc">已领取</view>
            <!-- <van-button type="primary" size="mini"></van-button> -->
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            ltextClone: '',
            rtextClone: '',
            pickClone: ''
        };
    },
    options: {
        multipleSlots: true // 在组件定义时的选项中启用多slot支持
    },
    props: {
        ltext: '',
        rtext: '',
        pick: false
    },
    methods: {
        showText(data) {
            this.setData({
                ltextClone: data.ltext,
                rtextClone: data.rtext,
                pickClone: data.pick
            });
        },
        pickFun() {
            this.setData({
                pickClone: true
            });
            uni.showToast({
                title: '领取成功'
            });
        }
    },
    created: function () {},
    watch: {
        ltext: {
            handler: function (newVal, oldVal) {
                this.ltextClone = newVal;
            },

            immediate: true
        },

        rtext: {
            handler: function (newVal, oldVal) {
                this.rtextClone = newVal;
            },

            immediate: true
        },

        pick: {
            handler: function (newVal, oldVal) {
                this.pickClone = newVal;
            },

            immediate: true
        }
    }
};
</script>
<style>
@import './index.css';
</style>
